Skip to content

Roll out site-wide citation popovers, local references, and citation cards (#200) - #1303

Merged
LukasWallrich merged 11 commits into
rebrand-doorsfrom
doors/citations-rollout-1062
Nov 24, 2026
Merged

LukasWallrich merged 11 commits into
rebrand-doorsfrom
doors/citations-rollout-1062

Conversation

@LukasWallrich

@LukasWallrich LukasWallrich commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

PR #1062 introduced site-wide citation popovers ({{< cite >}}, {{< references >}}, {{< citation-card >}}) backed by content/glossary/apa_lookup.json, but only piloted them on three Educators' Corner posts, cite_us.md, glossary terms, and two citation-card pages. Readers on the rest of the site still met plain-text citations, split reference lists, raw URLs inside popovers with no open-access indicator, and unstyled "How to cite" blocks without copy buttons.

This PR audits all non-generated pages on rebrand-doors, redesigns the citation popover into a lighter APA card with build-time OpenAlex/Unpaywall open-access enrichment (showing OA status and direct free-to-read links when a DOI is paywalled), hardens citation infrastructure for widget_page sections and page-local APA reference lists, and rolls out popovers, unified hanging-indent reference lists, and standardized citation cards across 12 hand-written pages.

Fixes #200

What changed

Citation popover redesign & build-time Open Access enrichment

  • Compact APA + action-bar popover (assets/js/doors/citations.js, assets/js/doors/popover.js, assets/css/doors/popover.css):
    • Quiet header row with an unlocked/locked padlock icon + OA status (Open access, Free copy · <Repository>, Paywalled, or Reference when no DOI) and an aligned × close button (44 px tap area).
    • Verbatim APA reference body with trailing raw https://doi.org/... / Available at: URL clutter stripped from display while Copy reference always copies the complete reference including its DOI/URL.
    • --surface footer bar pairing clean action links (Read free PDF ↗ / Read free copy ↗ + DOI ↗ for Green OA, Read article ↗ for direct OA, Publisher DOI ↗ for paywalled, Open source ↗ for non-DOI URLs) with an outlined Copy reference button and animated checkmark feedback.
    • Popovers reserve space for .site-head (when in view) and visible .cc-window cookie banners, clamp top and maxHeight together, and sit at z-index: 950 (above the collapsed Just-OS launcher at 900; below header at 1000 and open chat at 10000).
  • Build-time OpenAlex + Unpaywall OA enrichment (scripts/enrich_citation_oa.py, data/citation_oa.json, .github/workflows/data-processing.yml, layouts/partials/citations/metadata.html, layouts/partials/citations/entry.html, scripts/rebrand/check_source_rules.py):
    • Batched OpenAlex Works API lookup (40 DOIs/request, Unpaywall fallback for misses, 90-day cache) covering both content/glossary/apa_lookup.json and {{< local-references >}} DOIs — 429 / 431 DOIs enriched (208 direct OA, 78 paywalled papers with Green OA free copies, 143 paywalled).
    • Runs in data-processing.yml (offline/deterministic Hugo builds; zero runtime third-party API requests from browsers).

Shortcodes, author lists, checks & generator fixes

  • {{< cite >}} (layouts/shortcodes/cite.html): Added optional text="..." parameter to preserve each author's exact visible wording and punctuation while linking to #ref-<key>.
  • {{< local-references >}} (layouts/shortcodes/local-references.html): New paired shortcode for pages with manual APA reference lists not in apa_lookup.json. Merges any {{< cite >}} entries from .Page.Store alphabetically into one <ul class="references-list" data-local-references="true"> with author-collapse toggles and local-<md5> keys.
  • Page-local auto-linking (assets/js/doors/citations.js, assets/js/doors/citation-matches.js): Runs conservative author-year matching on .article-style when [data-local-references] is present (skipping links, headings, code, summaries, reference lists, citation cards, and glossary layouts), including optional p./pp. page locators on both parenthetical and narrative citations.
  • Author-list display (layouts/partials/citations/authors.html, layouts/shortcodes/citation-card.html, layouts/shortcodes/cite-us.html, assets/css/doors/citations.css): Suggested citations ({{< citation-card >}} and {{< cite-us >}}) now show up to 10 authors in full before collapsing (reference lists keep 5), and .ref-authors-toggle is styled as a plain inline underlined link instead of a floating bordered pill.
  • APA metadata & bibliography generator (layouts/partials/citations/metadata.html, bibtex_to_apa/bibtex_to_apa.js): Extended date regex for APA 7 full dates like (2021a, July 12) and hardened URL/DOI extraction for parenthetical DOIs (10.1002/(SICI)...); fixed bibtex_to_apa.js to normalise , & et al. → , et al. (Klein2014) and ^Forrt. → FORRT. (FORRT2019) on the next data-processing.yml run.
  • Reference list formatting & card CSS deduplication (assets/css/doors/citations.css, layouts/shortcodes/citation-card.html): Styled non-glossary .article-layout .article-style ul.references-list with clean APA hanging indents (1.5em) and overflow-wrap: anywhere; deduplicated cite_us.css <link> per page via .Page.Store.
  • Checks & docs (scripts/check_seo_html.py, scripts/tests/, CONTRIBUTING.md): Extended Check 15 to verify every a.cite[data-cite] resolves to a matching [data-reference] entry and fail on truncated data-source DOIs/URLs (both unbalanced parentheses and balanced-prefix truncation); added unit tests (test_enrich_citation_oa.py, test_citation_matches.py, test_check_seo_html.py).

Content rollout (12 non-generated pages)

  • Shared bibliography citations ({{< cite >}} + {{< references >}}):
    • content/manuscript/manuscript.md (widget_page): 4 exact citations inside {{< expand >}} (Vazire2018, Nosek2012Bar_Anan, Nosek2012b, FORRT2019) + {{< references >}}.
    • content/reversals/reversals.md (widget_page): 24 verified citations across 7 exact DOI-matched papers (Klein2014 ×12, EbersoleEtAl2016 ×5, Clark2019 ×2, Simonsohn2014effect ×2, Kerr2018 ×1, Mellers2001 ×1, Klein2018ManyLabs2 ×1) + {{< references >}} + standardized {{< citation-card >}} under How to cite.
    • content/educators-corner/011-intersectionality-open-science/index.md: 2 remaining citations (HenrichHeineNorenzayan2010, BahlaiEtAl2019) preserving exact visible text.
  • Page-local APA reference lists ({{< local-references >}}):
    • content/educators-corner/010-Neurodiversity/index.md: Unified split {{< references >}} + ### Other references (31 raw paragraphs) into one alphabetical ## References list (34 entries, 32 live popovers, 12 author toggles, References link in TOC).
    • content/educators-corner/018-accessible-feedback-in-research/index.md: Wrapped 8 manual references (7 live popovers).
    • content/educators-corner/016-reviewer-zero/index.md: Wrapped 5 manual references (all 5 live popovers) and removed 2 broken Zotero Google Docs draft links.
    • content/dei/2-intro-text.md (widget_page): Wrapped 4 manual references (all 5 in-text citations live, linking Henrich, Heine & Norenzayan, 2010 to the Nature 2010 entry listed on that page).
  • Standardized {{< citation-card >}} blocks:
    • content/pedagogies/001-Julia-Strand/index.md, 002-Gilad-Feldman/index.md, 003-CREP/index.md, 004-Thomas-Rhys-Evans/index.md (all 6 authors on 004 shown in full under the 10-author suggested-citation limit).
    • content/neurodiversity/neurodiversity.md (both Bibliographic Reference spoilers, with inline Show all 14 authors link on the 14-author entry).

Before & After

manuscript — Green OA popover (Free copy · OSF + DOI, 1440 px & 390 px)

Before (1440 px) After (1440 px) After (390 px)
manuscript-before-1440 manuscript-after-1440 manuscript-after-390

reversals — Direct Open Access popover + inline author link (1440 px & 390 px)

Before (1440 px) After (1440 px) After (390 px)
reversals-popover-before-1440 reversals-popover-after-1440 reversals-popover-after-390

Paywalled DOI (ec011) & Non-DOI local reference (ec018, 1440 px & 390 px)

Paywalled DOI (ec011, 1440 px) Non-DOI source (ec018, 1440 px) Non-DOI source (ec018, 390 px)
ec011-paywalled-after-1440 ec018-after-1440 ec018-after-390

Unified hanging-indent references (ec010 & ec004) and full-author citation card (ped004)

ec010 Before (1440 px) ec010 After (1440 px)
ec010-refs-before-1440 ec010-refs-after-1440
ped004 Before (1440 px) ped004 After (1440 px)
ped004-before-1440 ped004-after-1440
ec004 Before (1440 px) ec004 After (1440 px)
ec004-refs-before-1440 ec004-refs-after-1440

Decisions to review

  • Reversals How to cite wording & DOI links (content/reversals/reversals.md): "Please cite this source as Hartmann H…" was split into "Please cite this source as:", the {{< citation-card >}}, and "Contributors are listed…" as its own paragraph. Also, the 24 converted citations now open citation popovers alongside direct blue DOI links for non-bibliography studies on the same lines.
  • Unwrapped broken Zotero draft links (content/educators-corner/016-reviewer-zero/index.md): Removed two broken https://www.zotero.org/google-docs/?... links around (Silbiger & Stubler, 2019) and (Hamedani & Markus, 2019) (visible text unchanged) so they link to the page's References popovers instead.
  • Inferred matches on ec011 (content/educators-corner/011-intersectionality-open-science/index.md): HenrichHeineNorenzayan2010 (BBS WEIRD paper) and BahlaiEtAl2019 were matched from context since 011 has no existing reference list — please confirm.
  • Deliberately skipped pages: content/neurodiversity-lessonbank/ (deferred to avoid PR Neurodiversity Lesson Bank: embed Activity 1 H5P natively, fix #1016, and restyle for Doors #1294 conflicts), content/educators-corner/022-repro-metrics-forrt-irise/index.md (Vancouver numeric style), and all verified false-positive same-author-year traps.
  • Upstream bibliography quirks: Hardened bibtex_to_apa/bibtex_to_apa.js so FORRT2019 (Forrt.) and Klein2014 (, & et al.) normalise automatically on the next data-processing.yml run; apa_lookup.json itself is not hand-edited here per AGENTS.md.

Checks

  • hugo --gc --minify (0 errors, 0 new warnings) & node --check bibtex_to_apa/bibtex_to_apa.js
  • python3 -m unittest scripts/tests/test_citation_matches.py scripts/tests/test_check_seo_html.py scripts/tests/test_enrich_citation_oa.py (58 tests OK) and python3 -m unittest discover -s scripts -p 'test_parse_disciplines_gdoc.py' (11 tests OK)
  • python3 scripts/rebrand/check_source_rules.py --base origin/rebrand-doors (0 hard-coded URLs, 0 generated files changed)
  • python3 scripts/check_seo_html.py (all 28 checks PASS across 3,425 pages)
  • python3 scripts/rebrand/compare_builds.py (0 removed paths, 0 added addresses, 0 structured-data drops, 0 SEO tag changes)
  • axe-core audit on the redesigned Option B citation popover + modified pages (0 WCAG A/AA violations)
  • Playwright E2E suite at 1440 px & 390 px (Green OA, Open access, Paywalled, non-DOI Reference states; Copy reference preserves full DOI on clipboard while raw URL is hidden from display; inline author toggle; 10-author suggested citations; glossary regression check; 0 console/page errors)

Created with Gemini 4 Neon in Antigravity (reviewed with Claude Opus 5.5).

@LukasWallrich
LukasWallrich requested a review from a team as a code owner November 24, 2026 11:10
@github-actions

Copy link
Copy Markdown
Contributor

👍 All image files/references (if any) are in webp format, in line with our policy.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

📝 Spell Check Results

Found 6 potential spelling issue(s) when checking 31 changed file(s):

📄 content/reversals/reversals.md

Line Issue
2140 acn ==> can, acne

📄 layouts/partials/citations/authors.html

Line Issue
20 Alle ==> All, Alley
20 Autor ==> Author
20 Alle ==> All, Alley
20 Autor ==> Author
20 Autor ==> Author

ℹ️ How to address these issues:

  1. Fix the typo: If it's a genuine typo, please correct it.
  2. Add to whitelist: If it's a valid word (e.g., a name, technical term), add it to .codespell-ignore.txt
  3. False positive: If this is a false positive, please report it in the PR comments.

🤖 This check was performed by codespell

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 25 files

Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread assets/css/doors/popover.css Resolved
Comment thread assets/js/doors/popover.js Resolved
Comment thread assets/js/doors/citation-matches.js Resolved
Comment thread scripts/check_seo_html.py Resolved
Comment thread CONTRIBUTING.md Resolved
Comment thread assets/css/doors/citations.css Resolved
Comment thread assets/js/doors/popover.js Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread bibtex_to_apa/bibtex_to_apa.js Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 10 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread scripts/enrich_citation_oa.py Resolved
Comment thread .github/workflows/data-processing.yml Resolved
Comment thread assets/js/doors/citations.js Resolved
Comment thread assets/js/doors/citations.js Resolved
Comment thread scripts/enrich_citation_oa.py Resolved
Comment thread assets/js/doors/citations.js Resolved
Comment thread assets/css/doors/popover.css Resolved
Comment thread assets/js/doors/popover.js Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 7 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread assets/js/doors/popover.js Resolved
@LukasWallrich
LukasWallrich merged commit 6586812 into rebrand-doors Nov 24, 2026
9 of 10 checks passed
@LukasWallrich
LukasWallrich deleted the doors/citations-rollout-1062 branch November 24, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant